/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { Request, Response } from 'express';
import { responseSuccess } from '../utils';
import Mock, { mock } from 'mockjs';

export default {
  //全寄寄件黑名单
  'POST /regiment/Blacklist/list': (req: Request, res: Response) => {
    const data = Mock.mock({
      id: '@id',
      nickname: '@cname(4, 5)',
      mobile: '@phone',
      avatar_url: "@image('200x100', '#894FC4', '#FFF', 'png', '!')",
      'is_admin|1': ['0', '1'],
      regiment_id: '@id',
      kb_id: '@id',
      'attribute|1': ['团员', '团长', '加盟商'],
      league_name: '@cname(4, 5)',
      league_mobile: '@phone',
      league_id: '@id',
      'status|1': ['0', '1'],
      'black_type|1': ['0', '1', '2', '3'],
      black_brand: [
        'dp_offline',
        'yd_online',
        'yd_offline',
        'yt_online',
        'yt_offline',
        'sto_online',
        'sto_offline',
      ],
      brand: ['sf_offline', 'jd_online', 'sf_online'],
      remark: '@csentence(15)',
      regiment_name: '@cname(2, 4)',
      regiment_mobile: '@phone',
    });
    const result = {
      code: 0,
      msg: 'success',
      data,
    };
    return res.json(result);
  },
  'POST /regiment/Blacklist/edit': (req: Request, res: Response) => responseSuccess(req, res),
  'POST /regiment/Blacklist/getBrandList': (req: Request, res: Response) => {
    return res.json({
      code: 0,
      msg: 'success',
      data: {
        sf_online: '顺丰月结',
        sf_offline: '顺丰到现付',
        jd_online: '京东月结',
        jd_offline: '京东到现付',
        dp_online: '德邦月结',
        dp_offline: '德邦到现付',
        yd_online: '韵达月结',
        yd_offline: '韵达到现付',
        yt_online: '圆通月结',
        yt_offline: '圆通到现付',
        sto_online: '申通月结',
        sto_offline: '申通到现付',
      },
    });
  },
  'POST /AlipayTemplateMini/authMiniProgramList': (req: Request, res: Response) => {
    return res.json(
      mock({
        code: 0,
        msg: 'success',
        data: {
          'total|50-100': 50,
          'list|20': [
            {
              id: '@id',
              contactor: '@cword(3,6)',
              app_name: '@cword(3,6)',
              mobile: /1\d{10}/,
              auth_appid: '@id',
              appid: '@id',
              'inn_account|1': ['123123123', ''],
              create_time: '@datetime',
              check_time: '@datetime',
              update_time: '@datetime',
              refund_time: '@datetime',
              out_door_pic:
                'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
              'special_license_pic|3': [
                'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
              ],
              license_info: {
                license_name: '@cword(3,6)',
                license_number: /\d{15}/,
                license_valid_date: '@datetime',
                license_pic:
                  'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
              },
              'merchant|1': ['123123123', ''],
            },
          ],
        },
      }),
    );
  },
  'POST /AlipayTemplateMini/signPersonMiniProgram': (req: Request, res: Response) =>
    responseSuccess(req, res),
  'POST /AlipayTemplateMini/changeMiniProgramInnAccount': (req: Request, res: Response) =>
    responseSuccess(req, res),
  'POST  /AlipayTemplateMini/uploadMiniProgramLicensePic': (req: Request, res: Response) => {
    const result = {
      code: 0,
      msg: 'success',
      data: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
    };
    return res.json(result);
  },
  'POST /AlipayTemplateMini/saveMiniProgramLicense': (req: Request, res: Response) =>
    responseSuccess(req, res),
  'POST /AlipayTemplateMini/joinMiniProgramBuildTask': (req: Request, res: Response) =>
    responseSuccess(req, res),
};
